package com.shop2cn.iapi.openapibiz.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.shop2cn.iapi.openapibiz.service.GetAllThirdPartyAppCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
/**
*获取所有第三方应用
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_GetAllThirdPartyApp{
	private static GetAllThirdPartyAppCall getallthirdpartyappCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取所有第三方应用");
	}

	@Before
	public void caseUp() {
		getallthirdpartyappCall=new GetAllThirdPartyAppCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getallthirdpartyappCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetAllThirdPartyApp_001() {
		Logger.start(true,"获取所有第三方应用");
		try {
		
			getallthirdpartyappCall.callService();	
			
//			Logger.verifyEquals("200", getallthirdpartyappCall.getCode(), "验证Code");
//
//			List<ThirdPartyApp> apps = getallthirdpartyappCall.getThirdPartyApps().getContent();
//			List<Application> applications = new OpenApiWapper().selectEnableThirdPartyApplication();
//			
//			Logger.verifyEquals(applications.size(), apps.size(), "验证Code");
//			
//			for(int i=0;i<apps.size();i++)
//			{
//				Logger.verifyEquals(applications.get(i).getApp_id(), apps.get(i).getAppId(), "验证AppId");
//				Logger.verifyEquals(applications.get(i).getApp_name(), apps.get(i).getAppName(), "验证AppName");
//			}

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}